<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>采摘园列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="author" content="Bluth Company">
    <link rel="shortcut icon" href="__STATIC__/admin/assets/ico/favicon.html">
    <link href="__STATIC__/admin/assets/css/bootstrap.css" rel="stylesheet">
    <link href="__STATIC__/admin/assets/css/theme.css" rel="stylesheet">
    <link href="__STATIC__/admin/assets/css/font-awesome.min.css" rel="stylesheet">
    <link href="__STATIC__/admin/assets/css/alertify.css" rel="stylesheet">
    <link rel="Favicon Icon" href="favicon.ico">

  </head>
  <body>
  {include file="public:head"/}

    <div class="container-fluid">
  {include file="public:sidemenu"/}
     

 <!-- Main window -->
      <div class="main_container" id="users_page">

        <div class="row-fluid">
          <ul class="breadcrumb">
            <li><a href="#">Home</a> <span class="divider">/</span></li>
            <li><a href="#">Pages</a> <span class="divider">/</span></li>
            <li class="active">Users</li>
          </ul>
      

        <div class="row-fluid">
          <div class="widget widget-padding span12">
            <div class="widget-header">
              <i class="icon-group"></i>
              <h5>采摘园</h5>
              <div class="widget-buttons">
                  <a href="#add_modal" data-title="Add User" data-toggle="modal" data-

target="#example_modal"><i class="icon-plus"></i></a>
                  <a href="#" data-title="Collapse" data-collapsed="false" class="collapse"><i 

class="icon-chevron-up"></i></a>
              </div>
            </div>  
            <div class="widget-body">
              <table id="users" class="table table-striped table-bordered dataTable">
                <thead>
                  <tr>
                  <th>作业名称</th>
                  <th>课程名称</th>
                  <th>课程要求</th>
                  <th>附件</th>
                  <th>发布时间</th>
                  <th>截止时间</th>
                </tr>
                </thead>
                <tbody>

                  {volist name="works" id="vo"}
                  <tr>
                  <td style="width:50px">{$vo.workname631</td>
                    <td style="width:50px">{$vo.classname631}</td>
                   <td style="width:50px">{$vo.require631}</td>
                    <td style="width:100px">{$vo.extra631}</td>
                    <td style="width:100px">{$vo.showtime631}</td>
                    <td style="width:100px">{$vo.endtime631}</td>
                  <td></td>
                  <td>
                      <div class="btn-group">
                        <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
                        操作
                          <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu pull-right">
                          <li><a href="#" onclick="query_video({$vo.workname})"><i class="icon-edit" ></i> 编辑</a></li>
                          <li><a href="{:url('Homework/delete',['id'=>$vo.workname])}"><i class="icon-trash"></i> 删除</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>
                {/volist}
                  
                </tbody>
              </table>
           
            </div> <!-- /widget-body -->
          </div> <!-- /widget -->
        </div> <!-- /row-fluid -->

      </div>
      <!-- /Main window -->

    </div><!--/.fluid-container-->
    </div><!-- wrap ends-->

     <!-- Example Modal -->
    <div id="add_modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">添加采摘园</h3>
      </div>
      <div class="modal-body">

        <form class="form-horizontal" method="POST" action="{:url('List631/add')}" enctype="multipart/form-data">
                  <div class="control-group">
                    <label class="control-label"> 采摘园名：</label>
                    <div class="controls">
                      <input class="span3" type="text" name="gardenname" placeholder="请输入">
                    </div>
                  </div>

                  <div class="control-group">
                    <label class="control-label"> 图片：</label>
                    <div class="controls">
                      <input class="span3" type="file" id="pic" name="poster">
                    </div>
                  </div>
                  
                  <div class="control-group">
                    <label class="control-label"> 采摘园类型：</label>
                      <div class="controls">
                        <select  class="span3" name="tid">
                          {volist name="ctype" id="vo"}
                            <option value='{$vo.tid631}'>{$vo.typename631}</option>
                          {/volist}
                        </select>
                     </div>
                  </div>

                  <div class="control-group">
                    <label class="control-label"> 简介：</label>
                      <div class="controls">
                        <textarea class="span3" rows="5" name="intro" style="height:100px;"></textarea>
                      </div>
                  </div>

                   <div class="control-group">
                    <label class="control-label"> 开园时间：</label>
                    <div class="controls">
                      <input class="span3" type="text" name="opentime" placeholder="请输入">
                    </div>
                  </div>

                  <div class="control-group">
                    <label class="control-label"> 地址：</label>
                    <div class="controls">
                      <input class="span3" type="text" name="address" placeholder="请输入">
                    </div>
                  </div>

      </div>
      <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <button class="btn btn-primary"> 确认添加</button>

        </form>
      </div>
    </div>  



  {include file="public:footer"/}

    <script type="text/javascript">
    function query_video(vid)
      {

        $.ajax(
        {
            url : "{:url('video/select')}",
            type : "POST",
            data : {
              "vid" : vid
            },
            success : showQuery,
            error : function(jqXHR, textStatus, errorThrown) {
              alert(jqXHR.statusText);
            },
            dataType : "json"
        });
        
      }      

      function showQuery(data)
      {
          $('#vid1').val(data.vid);
          $('#tid1').val(data.tid);
          $('#videoname1').val(data.videoname);
          $('#intro1').val(data.intro);
          $('#address1').val(data.address);
          $('#edit_modal').modal('show');
      }
  </script>
  </body>
  }
</html>
